//
//  HistoryIncomingTableViewCell.m
//  HYApp
//
//  Created by Jianbo Cai on 2020/8/14.
//  Copyright © 2020 Unidax. All rights reserved.
//

#import "HistoryIncomingTableViewCell.h"

@interface HistoryIncomingTableViewCell ()

@end

@implementation HistoryIncomingTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setEntity:(IncomingListEntity *)entity {
    _entity = entity;
    self.timeLabel.text = entity.date;
    
    if ([self.entity.type rangeOfString:@"DEPOSIT"].location != NSNotFound) {
        self.nameLabel.text = JFMainLocalizedString(@"deposit.deposit");
    }else if ([self.entity.type rangeOfString:@"WITHDRAW"].location != NSNotFound) {
        self.nameLabel.text = JFMainLocalizedString(@"withdraw.withdraw");
    }
//    self.nameLabel.text = [[[entity.type componentsSeparatedByString:@"_"]firstObject] capitalizedString];
//    self.amountLabel.text = [NSString stringWithFormat:@"%@ %@", MoneyFormat(entity.amount), entity.asset_symbol];
    self.statusLabel.text = entity.status;
    if ([self.entity.type rangeOfString:@"FIAT"].location != NSNotFound) {
        self.amountLabel.text = [NSString stringWithFormat:@"%@ %@", MoneyFormat(self.entity.amount), self.entity.asset_symbol];
    }else {
        self.amountLabel.text = [NSString stringWithFormat:@"%@ %@", self.entity.amount, self.entity.asset_symbol];
    }
}

@end
